#ifndef _MONITOR_PLATFORM_IOT_H_
#define _MONITOR_PLATFORM_IOT_H_

#include "sys_hc32f460.h"

#define ZX_STX_H    0x4E 
#define ZX_STX_L    0x57
#define ZX_EOD      0x68

typedef enum {
    sket_read_single_param  = 0x03,//读取单个数据
    sket_read_all_param     = 0x06,//读取所有数据
}SKET_Read_Type;

//告警标志位
typedef union{
    struct {
        uint16_t  SocLow:1;                                                //电量过低告警
        uint16_t  MosTempHigh:1;                                           //MOS管超温报警
        uint16_t  ChgVolHigh:1;                                            //充电过压报警
        uint16_t  DsgVolLow:1;                                             //放电欠压报警
        uint16_t  BatTempHigh:1;                                           //温度过高告警
        uint16_t  ChangeCurr:1;                                            //充电过流
        uint16_t  DisChaCurr:1;                                            //放电过流
        uint16_t  CellVolDiffHigh:1;                                       //电芯压差报警

        uint16_t  BoxTempHigh:1;                                           //电池箱内超温报警
        uint16_t  BatTempLow:1;                                            //温度过低告警
        uint16_t  CellVolHigh:1;                                           //单体过压告警
        uint16_t  CellVolLow:1;                                            //单体欠压告警
        uint16_t  A_309:1;                                                 //309_A保护
        uint16_t  B_309:1;                                                 //309_B保护
        uint16_t  humiHigh:1;                                              //湿度报警
        uint16_t  rmBit:1;
    }bit;
    uint16_t value;
}Sket_Warn_Bits;

//告警标志位
typedef union{
    struct {
        uint16_t  chgMos:1;                                                //电量过低告警
        uint16_t  dsgMos:1;                                           //MOS管超温报警
        uint16_t  balSW:1;                                            //充电过压报警
        uint16_t  lossCell:1;                                             //放电欠压报警
        uint16_t  chgMosErr:1;                                           //温度过高告警
        uint16_t  dsgMosErr:1;                                            //充电过流
        uint16_t  rmBit:10;
    }bit;
    uint16_t value;
}Sket_State_Bits;

void sket_recv_data(uint8_t *data, uint16_t len,uint8_t comNum);
#endif /* APPLICATIONS_IOT_CONTROL_H_ */
